package com.hxalex.simulationhandle.accessbilityService.command.search;

import android.view.accessibility.AccessibilityNodeInfo;

import com.hxalex.simulationhandle.accessbilityService.command.base.BaseCommand;
import com.hxalex.simulationhandle.accessbilityService.manger.SearchManger;
import com.hxalex.simulationhandle.accessbilityService.receiver.base.BaseReceiver;
import com.hxalex.simulationhandle.accessbilityService.receiver.search.SearchBaiduInfoReceiver;

/**
 * Created by hx_Alex on 2018/5/26.
 */

public class SearchBaiduInfoCommand extends BaseCommand {
    private AccessibilityNodeInfo nodeInfo;
    public SearchBaiduInfoCommand(SearchManger searchManger, BaseReceiver receiver) {
        super(searchManger, receiver);
    }

    public AccessibilityNodeInfo getNodeInfo() {
        return nodeInfo;
    }

    public void setNodeInfo(AccessibilityNodeInfo nodeInfo) {
        this.nodeInfo = nodeInfo;
    }

    @Override
    public void execute() {
       if(receiver instanceof SearchBaiduInfoReceiver)
       {
           ((SearchBaiduInfoReceiver)receiver).setNodeInfo(nodeInfo);
           receiver.doSomething();
       }
    }
}
